new Vue({
    el: "#app",
    data() {
        return {

            LoginFormDTO: {
                phone: "",
                password: "",

            },
        }
    },
    methods: {
        // 登录
        login() {
            let _this = this


            axios({
                method: "post",
                url: "http://localhost:8088/users/login",
                data: _this.LoginFormDTO
            }).then(function (resp) {

                if (!resp.data.flag) {
                    _this.$message({
                        message: resp.data.message,
                        type: 'error'
                    });
                } else {
                    _this.$message({
                        message: resp.data.message,
                        type: 'success'
                    });
                    localStorage.authorization = resp.data.data.token
                    localStorage.id = resp.data.data.id

                    setTimeout(function () {
                        location.href = "platform.html"
                    }, 1000)

                }

            })



        },
        // 清除
        clear() {
            this.LoginFormDTO = {}
        }
    }
})